﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using UnityEngine;
using XUpdater;

namespace XUtliPoolLib
{
	// Token: 0x020001C7 RID: 455
	public sealed class XResourceLoaderMgr : XSingleton<XResourceLoaderMgr>
	{
		// Token: 0x06000A41 RID: 2625 RVA: 0x00035ED8 File Offset: 0x000340D8
		public XResourceLoaderMgr()
		{
			this.xmlSerializerCache[0] = new XmlSerializer(typeof(XSkillData));
			this.xmlSerializerCache[1] = new XmlSerializer(typeof(XCutSceneData));
			this._prefixHash = XSingleton<XCommon>.singleton.XHashLowerRelpaceDot(this._prefixHash, "Assets.Resources.");
		}

		// Token: 0x06000A42 RID: 2626 RVA: 0x00036024 File Offset: 0x00034224
		public void LoadServerCurve(string location)
		{
#if EDIT_DATA
            if (location.StartsWith("Table"))
            {
                string _outpath = Application.persistentDataPath + string.Format("/{0}/{1}{2}", new object[]
                {
				location_prefix,
				location,
                ".bytes"
                });
                //StreamReader sr = new StreamReader("c:/jamaica.txt")
                using (FileStream fsRead = new FileStream(_outpath, FileMode.Open))
                {
                    int fsLen = (int)fsRead.Length;
                    byte[] heByte = new byte[fsLen];
                    int r = fsRead.Read(heByte, 0, heByte.Length);
                    //string myStr = System.Text.Encoding.UTF8.GetString(heByte);

                    XBinaryReader xbinaryReader2 = XBinaryReader.Get();
                    xbinaryReader2.InitByte(heByte);
					int count= xbinaryReader2.ReadInt32();
                    XSingleton<XDebug>.singleton.AddLog("loadServerCurve" + count, null, null, null, null, null, XDebugColor.XDebug_None);
                    this.m_curveData = new List<FloatCurve>(count);
                    for (int i = 0; i < count; i++)
                    {
                        FloatCurve floatCurve = new FloatCurve();
                        floatCurve.namehash = xbinaryReader2.ReadUInt32();
                        floatCurve.maxValue = xbinaryReader2.ReadInt16();
                        floatCurve.landValue = xbinaryReader2.ReadInt16();
                        int num2 = xbinaryReader2.ReadInt32();
                        if (num2 > 0)
                        {
                            floatCurve.value = new short[num2];
                            for (int j = 0; j < num2; j++)
                            {
                                floatCurve.value[j] = xbinaryReader2.ReadInt16();
                            }
                        }
                        this.m_curveData.Add(floatCurve);
                    }
                    XBinaryReader.Return(xbinaryReader2, false);
					return;
				}
            }
#endif
            TextAsset sharedResource = this.GetSharedResource<TextAsset>(location, ".bytes", true, false);
			if (sharedResource == null || sharedResource.bytes == null)
			{
				XResourceLoaderMgr.LoadErrorLog(location);
			}
			XBinaryReader xbinaryReader = XBinaryReader.Get();
			xbinaryReader.Init(sharedResource);
			int num = xbinaryReader.ReadInt32();
			XSingleton<XDebug>.singleton.AddLog("loadServerCurve" + num, null, null, null, null, null, XDebugColor.XDebug_None);
			this.m_curveData = new List<FloatCurve>(num);
			for (int i = 0; i < num; i++)
			{
				FloatCurve floatCurve = new FloatCurve();
				floatCurve.namehash = xbinaryReader.ReadUInt32();
				floatCurve.maxValue = xbinaryReader.ReadInt16();
				floatCurve.landValue = xbinaryReader.ReadInt16();
				int num2 = xbinaryReader.ReadInt32();
				if (num2 > 0)
				{
					floatCurve.value = new short[num2];
					for (int j = 0; j < num2; j++)
					{
						floatCurve.value[j] = xbinaryReader.ReadInt16();
					}
				}
				this.m_curveData.Add(floatCurve);
			}
			XBinaryReader.Return(xbinaryReader, false);
			this.UnSafeDestroyShareResource(location, ".bytes", sharedResource, false);
		}

		// Token: 0x06000A43 RID: 2627 RVA: 0x00036164 File Offset: 0x00034364
		public void ReleasePool()
		{
			if (this.useNewMgr)
			{
				foreach (KeyValuePair<uint, XResourceLoaderMgr.UniteObjectInfo> keyValuePair in this.m_assetPool)
				{
					XResourceLoaderMgr.UniteObjectInfo value = keyValuePair.Value;
					if (value.asset != null)
					{
						if (!value.IsDontDestroyAsset && !value.IsDegeneration)
						{
							keyValuePair.Value.ClearPool();
							if (value.HasPreload && value.refCount == 0)
							{
								value.IsDegeneration = true;
								value.degenerationTime = 2f;
								if (this.m_degenerationQueue == null)
								{
									this.m_degenerationQueue = value;
									this.m_currentDegeneration = value;
								}
								else
								{
									if (this.m_currentDegeneration != null)
									{
										this.m_currentDegeneration.next = value;
										this.m_currentDegeneration = value;
									}
								}
								if (value.asset != null)
								{
									this.m_instanceIDAssetMap.Remove(value.asset.GetInstanceID());
								}
							}
							else
							{
								XSingleton<XDebug>.singleton.AddWarningLog2("Asset Not Release:{0} Ref:{1}", new object[]
								{
									value.loc,
									value.refCount
								});
							}
						}
					}
					else
					{
						XSingleton<XDebug>.singleton.AddWarningLog2("Asset null:{0} Ref:{1}", new object[]
						{
							value.loc,
							value.refCount
						});
					}
				}
				this.DelayDestroy(0f, true);
			}
			else
			{
				foreach (KeyValuePair<uint, Queue<UnityEngine.Object>> keyValuePair2 in this._object_pool)
				{
					while (keyValuePair2.Value.Count > 0)
					{
						this.UnSafeDestroy(keyValuePair2.Value.Dequeue(), false, true);
					}
				}
				this._object_pool.Clear();
				this._asset_pool.Clear();
				this._script_pool.Clear();
				List<uint> list = new List<uint>(this._asset_ref_count.Keys);
				for (int i = 0; i < list.Count; i++)
				{
					this._asset_ref_count[list[i]] = 0;
				}
				foreach (KeyValuePair<uint, AssetBundleInfo> keyValuePair3 in this._bundle_pool)
				{
					keyValuePair3.Value.Release();
				}
				this._bundle_pool.Clear();
			}
			XSingleton<XDebug>.singleton.AddWarningLog2("ResourceLoad:{0} ABLoad:{1} Instance:{2}", new object[]
			{
				XResourceLoaderMgr.resourceLoadCount,
				XResourceLoaderMgr.abLoadCount,
				XResourceLoaderMgr.instanceCount
			});
			XResourceLoaderMgr.resourceLoadCount = 0;
			XResourceLoaderMgr.abLoadCount = 0;
			XResourceLoaderMgr.instanceCount = 0;
			this.isCurrentLoading = false;
			for (int j = 0; j < this._async_task_list.Count; j++)
			{
				this._async_task_list[j].Clear();
			}
			this._async_task_list.Clear();
			this.shareMemoryStream.Close();
			this.shareMemoryStream = new MemoryStream(8192);
			XSingleton<XEngineCommandMgr>.singleton.Clear();
			this.delayUpdateList.Clear();
		}

		// Token: 0x06000A44 RID: 2628 RVA: 0x0003654C File Offset: 0x0003474C
		public void DebugPrint()
		{
			foreach (KeyValuePair<uint, XResourceLoaderMgr.UniteObjectInfo> keyValuePair in this.m_assetPool)
			{
				XResourceLoaderMgr.UniteObjectInfo value = keyValuePair.Value;
				if (value.asset != null)
				{
					if (!value.IsDontDestroyAsset)
					{
						XSingleton<XDebug>.singleton.AddWarningLog2("Asset Not Release:{0} Ref:{1}", new object[]
						{
							value.loc,
							value.refCount
						});
					}
				}
				else
				{
					XSingleton<XDebug>.singleton.AddWarningLog2("Asset null:{0} Ref:{1}", new object[]
					{
						value.loc,
						value.refCount
					});
				}
			}
		}

		// Token: 0x06000A45 RID: 2629 RVA: 0x0003662C File Offset: 0x0003482C
		public void SetUnloadCallback(BeforeUnityUnLoadResource cb)
		{
			this.m_BeforeUnityUnLoadResourceCb = cb;
		}

		// Token: 0x06000A46 RID: 2630 RVA: 0x00036638 File Offset: 0x00034838
		public void CallUnloadCallback()
		{
			if (this.m_BeforeUnityUnLoadResourceCb != null)
			{
				this.m_BeforeUnityUnLoadResourceCb();
			}
		}

		// Token: 0x06000A47 RID: 2631 RVA: 0x00036664 File Offset: 0x00034864
		private uint Hash(string location, string ext)
		{
			uint hash = XSingleton<XCommon>.singleton.XHashLowerRelpaceDot(this._prefixHash, location);
			return XSingleton<XCommon>.singleton.XHashLowerRelpaceDot(hash, ext);
		}

		// Token: 0x06000A48 RID: 2632 RVA: 0x00036698 File Offset: 0x00034898
		public Stream ReadText(string location, string suffix, bool error = true)
		{
#if EDIT_DATA
            if (location.StartsWith("Table"))
            {
                string _outpath = Application.persistentDataPath + string.Format("/{0}/{1}{2}", new object[]
                {
				location_prefix,
				location,
				suffix
				});
                //StreamReader sr = new StreamReader("c:/jamaica.txt")
                using (FileStream fsRead = new FileStream(_outpath, FileMode.Open))
                {
                    int fsLen = (int)fsRead.Length;
                    byte[] heByte = new byte[fsLen];
                    int r = fsRead.Read(heByte, 0, heByte.Length);
                    //string myStr = System.Text.Encoding.UTF8.GetString(heByte);
					Stream ret;
                    try
                    {
                        this.shareMemoryStream.SetLength(0L);
                        this.shareMemoryStream.Write(heByte, 0, heByte.Length);
                        this.shareMemoryStream.Seek(0L, SeekOrigin.Begin);
						ret = this.shareMemoryStream;
                    }
                    catch (Exception ex)
                    {
                        XSingleton<XDebug>.singleton.AddErrorLog(ex.Message, location, null, null, null, null);
						ret = this.shareMemoryStream;
                    }
                    return ret;

                }
            }
#endif
            TextAsset sharedResource = this.GetSharedResource<TextAsset>(location, suffix, error, false);
			if (sharedResource == null)
			{
				if (!error)
				{
					return null;
				}
				XResourceLoaderMgr.LoadErrorLog(location);
			}
			Stream result;
			try
			{
				this.shareMemoryStream.SetLength(0L);
				this.shareMemoryStream.Write(sharedResource.bytes, 0, sharedResource.bytes.Length);
				this.shareMemoryStream.Seek(0L, SeekOrigin.Begin);
				result = this.shareMemoryStream;
			}
			catch (Exception ex)
			{
				XSingleton<XDebug>.singleton.AddErrorLog(ex.Message, location, null, null, null, null);
				result = this.shareMemoryStream;
			}
			finally
			{
				this.UnSafeDestroyShareResource(location, suffix, sharedResource, false);
			}
			return result;
		}

		// Token: 0x06000A49 RID: 2633 RVA: 0x00036764 File Offset: 0x00034964
		public void ClearStream(Stream s)
		{
			if (s != null)
			{
				if (s == this.shareMemoryStream)
				{
					this.shareMemoryStream.SetLength(0L);
				}
				else
				{
					s.Close();
				}
			}
		}

		// Token: 0x06000A4A RID: 2634 RVA: 0x000367A4 File Offset: 0x000349A4
		public XBinaryReader ReadBinary(string location, string suffix, bool readShareResource, bool error = true)
		{
			TextAsset sharedResource = this.GetSharedResource<TextAsset>(location, suffix, error, false);
			if (sharedResource == null)
			{
				if (!error)
				{
					return null;
				}
				XResourceLoaderMgr.LoadErrorLog(location);
			}
			XBinaryReader result;
			try
			{
				XBinaryReader xbinaryReader = XBinaryReader.Get();
				xbinaryReader.Init(sharedResource);
				this.UnSafeDestroyShareResource(location, suffix, sharedResource, false);
				result = xbinaryReader;
			}
			catch (Exception ex)
			{
				XSingleton<XDebug>.singleton.AddErrorLog(ex.Message, location, null, null, null, null);
				result = null;
			}
			return result;
		}

		// Token: 0x06000A4B RID: 2635 RVA: 0x00036834 File Offset: 0x00034A34
		public void ClearBinary(XBinaryReader reader, bool readShareResource)
		{
			if (reader != null)
			{
				XBinaryReader.Return(reader, readShareResource);
			}
		}

		// Token: 0x06000A4C RID: 2636 RVA: 0x00036854 File Offset: 0x00034A54
		public bool ReadText(string location, string suffix, XBinaryReader stream, bool error = true)
		{
#if EDIT_DATA
            if (location.StartsWith("Table"))
            {
                string _outpath = Application.persistentDataPath + string.Format("/{0}/{1}{2}", new object[]
                {
				location_prefix,
				location,
                suffix
                });
                //StreamReader sr = new StreamReader("c:/jamaica.txt")
                using (FileStream fsRead = new FileStream(_outpath, FileMode.Open))
                {
                    int fsLen = (int)fsRead.Length;
                    byte[] heByte = new byte[fsLen];
                    int r = fsRead.Read(heByte, 0, heByte.Length);
					//string myStr = System.Text.Encoding.UTF8.GetString(heByte);
					stream.InitByte(heByte);
					return true;
				}
            }
#endif
            TextAsset sharedResource = this.GetSharedResource<TextAsset>(location, suffix, error, false);
			if (sharedResource == null)
			{
				if (error)
				{
					XResourceLoaderMgr.LoadErrorLog(location);
				}
				return false;
			}
			stream.Init(sharedResource);
			this.UnSafeDestroyShareResource(location, suffix, sharedResource, false);
			return true;
		}

		// Token: 0x06000A4D RID: 2637 RVA: 0x000368A8 File Offset: 0x00034AA8
		public TextAsset ReadLuaBytes(string filename_without_ext)
		{
			string location = "lua/Hotfix/" + filename_without_ext;
			TextAsset sharedResource = this.GetSharedResource<TextAsset>(location, ".txt", false, false);
			if (sharedResource == null)
			{
				return null;
			}
			return sharedResource;
		}

		// Token: 0x06000A4E RID: 2638 RVA: 0x000368E8 File Offset: 0x00034AE8
		public void ReleaseLuaBytes(string filename_without_ext, TextAsset data)
		{
			string location = "lua/Hotfix/" + filename_without_ext;
			this.UnSafeDestroyShareResource(location, ".txt", data, false);
		}

		// Token: 0x06000A4F RID: 2639 RVA: 0x00036914 File Offset: 0x00034B14
		public bool ReadFile(string location, CVSReader reader)
		{
#if EDIT_DATA
			if (location.StartsWith("Table"))
			{
				bool ret = true;
				string _outpath = Application.persistentDataPath + string.Format("/{0}/{1}{2}", new object[]
                {
				location_prefix,
				location,
				".bytes"
				});
                //StreamReader sr = new StreamReader("c:/jamaica.txt")
                using (FileStream fsRead = new FileStream(_outpath, FileMode.Open))
                {
                    int fsLen = (int)fsRead.Length;
                    byte[] heByte = new byte[fsLen];
                    int r = fsRead.Read(heByte, 0, heByte.Length);
                    //string myStr = System.Text.Encoding.UTF8.GetString(heByte);

                    XBinaryReader xbinaryReader2 = XBinaryReader.Get();
					xbinaryReader2.InitByte(heByte);
                    try
                    {
						ret = reader.ReadFile(xbinaryReader2);
                        if (!ret)
                        {
                            XSingleton<XDebug>.singleton.AddErrorLog("in File: ", location, reader.error, null, null, null);
                        }
                    }
                    catch (Exception ex)
                    {
                        XSingleton<XDebug>.singleton.AddErrorLog(ex.Message, " in File: ", location, reader.error, null, null);
						ret = false;
                    }
                    finally
                    {
                        XBinaryReader.Return(xbinaryReader2, false);
                    }
					return ret;

				}
            }
#endif
            TextAsset textAsset = null;
			textAsset = this.GetSharedResource<TextAsset>(location, ".bytes", true, false);
			if (textAsset == null || textAsset.bytes == null)
			{
				XResourceLoaderMgr.LoadErrorLog(location);
			}
			bool result = true;
			XBinaryReader xbinaryReader = XBinaryReader.Get();
			xbinaryReader.Init(textAsset);
			try
			{
				result = reader.ReadFile(xbinaryReader);
				if (!result)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("in File: ", location, reader.error, null, null, null);
				}
			}
			catch (Exception ex)
			{
				XSingleton<XDebug>.singleton.AddErrorLog(ex.Message, " in File: ", location, reader.error, null, null);
				result = false;
			}
			finally
			{
				XBinaryReader.Return(xbinaryReader, false);
			}
			this.UnSafeDestroyShareResource(location, ".bytes", textAsset, false);
			return result;
		}

		// Token: 0x06000A50 RID: 2640 RVA: 0x000369FC File Offset: 0x00034BFC
		public bool ReadFile(TextAsset data, CVSReader reader)
		{
			if (data == null || reader == null)
			{
				return false;
			}
			XBinaryReader xbinaryReader = XBinaryReader.Get();
			xbinaryReader.Init(data);
			bool result = true;
			try
			{
				result = reader.ReadFile(xbinaryReader);
				return result;
			}
			catch (Exception ex)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("ReadFile: ", ex.Message, null, null, null, null);
				result = false;
			}
			finally
			{
				XBinaryReader.Return(xbinaryReader, false);
			}
			return result;
		}

		// Token: 0x06000A51 RID: 2641 RVA: 0x00036A90 File Offset: 0x00034C90
		public void CreateInAdvance(string location, int num, ECreateHideType hideType)
		{
			if (location != null && location.Length != 0)
			{
				uint num2 = this.Hash(location, ".prefab");
				int num3 = 0;
				if (this.useNewMgr)
				{
					XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo = null;
					if (this.m_assetPool.TryGetValue(num2, out uniteObjectInfo))
					{
						if (uniteObjectInfo.objPool != null)
						{
							num3 = uniteObjectInfo.objPool.Count;
						}
					}
					else
					{
						uniteObjectInfo = this.GetObjectInfo();
						uniteObjectInfo.Init(location, ".prefab", num2, false, typeof(GameObject), true);
						this.m_assetPool.Add(num2, uniteObjectInfo);
					}
					if (uniteObjectInfo.objPool == null)
					{
						uniteObjectInfo.objPool = QueuePool<UnityEngine.Object>.Get();
					}
					for (int i = 0; i < num - num3; i++)
					{
						if (uniteObjectInfo.asset != null)
						{
							GameObject gameObject = XCommon.Instantiate<UnityEngine.Object>(uniteObjectInfo.asset) as GameObject;
							if (gameObject != null)
							{
								uniteObjectInfo.objPool.Enqueue(gameObject);
								switch (hideType)
								{
								case ECreateHideType.DisableObject:
									gameObject.SetActive(false);
									break;
								case ECreateHideType.DisableAnim:
								{
									Animator componentInChildren = gameObject.GetComponentInChildren<Animator>();
									if (componentInChildren != null)
									{
										componentInChildren.enabled = false;
									}
									break;
								}
								case ECreateHideType.DisableParticleRenderer:
									XSingleton<XCommon>.singleton.EnableParticleRenderer(gameObject, false);
									break;
								}
							}
						}
					}
				}
				else
				{
					if (this._object_pool.ContainsKey(num2))
					{
						Queue<UnityEngine.Object> queue = this._object_pool[num2];
						num3 = queue.Count;
					}
					for (int j = 0; j < num - num3; j++)
					{
						UnityEngine.Object @object = this.CreateFromPrefab(location, false, false);
						this.AddToObjectPool(num2, @object);
						GameObject gameObject2 = @object as GameObject;
						if (gameObject2 != null)
						{
							switch (hideType)
							{
							case ECreateHideType.DisableObject:
								gameObject2.SetActive(false);
								break;
							case ECreateHideType.DisableAnim:
							{
								Animator componentInChildren2 = gameObject2.GetComponentInChildren<Animator>();
								bool flag11 = componentInChildren2 != null;
								if (flag11)
								{
									componentInChildren2.enabled = false;
								}
								break;
							}
							case ECreateHideType.DisableParticleRenderer:
								XSingleton<XCommon>.singleton.EnableParticleRenderer(gameObject2, false);
								break;
							}
						}
					}
				}
			}
		}

		// Token: 0x06000A52 RID: 2642 RVA: 0x00036D0C File Offset: 0x00034F0C
		public XResourceLoaderMgr.UniteObjectInfo GetUOI(uint hash, out UnityEngine.Object obj, bool useObjPool)
		{
			XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo = null;
			obj = null;
			if (this.m_assetPool.TryGetValue(hash, out uniteObjectInfo))
			{
				obj = uniteObjectInfo.Get(useObjPool, false);
				return uniteObjectInfo;
			}
			return null;
		}

		// Token: 0x06000A53 RID: 2643 RVA: 0x00036D48 File Offset: 0x00034F48
		public bool GetUOIAsync(string location, uint hash, UnityEngine.Object asset, AssetBundleInfo info, bool isSharedResource, out XResourceLoaderMgr.UniteObjectInfo uoi)
		{
			uoi = null;
			if (this.m_assetPool.TryGetValue(hash, out uoi))
			{
				XSingleton<XDebug>.singleton.AddWarningLog2("LoadAsync asset:{0},already loaded.", new object[]
				{
					location
				});
				if (asset != uoi.asset)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("not same asset at same path.", null, null, null, null, null);
				}
				return false;
			}

			uoi = this.GetObjectInfo();
			bool result = uoi.InitAsync(location, hash, asset, info, isSharedResource, true);
			if (isSharedResource && uoi.asset != null)
			{
				int instanceID = uoi.asset.GetInstanceID();
				if (this.m_instanceIDAssetMap.ContainsKey(instanceID))
				{
					XSingleton<XDebug>.singleton.AddErrorLog2("same key already exists in the dictionary:{0}", new object[]
					{
						uoi.asset.name
					});
				}
				else
				{
					this.m_instanceIDAssetMap[instanceID] = uoi;
				}
			}
			this.m_assetPool.Add(hash, uoi);
			return result;
			
		}

		// Token: 0x06000A54 RID: 2644 RVA: 0x00036E64 File Offset: 0x00035064
		public UnityEngine.Object GetUOI(XResourceLoaderMgr.UniteObjectInfo uoi, bool isSharedResource, bool useObjPool)
		{
			UnityEngine.Object @object = uoi.Get(useObjPool, false);
			if (!isSharedResource)
			{
				int instanceID = @object.GetInstanceID();
				if (this.m_instanceIDAssetMap.ContainsKey(instanceID))
				{
					XSingleton<XDebug>.singleton.AddErrorLog2("same key already exists in the dictionary:{0}", new object[]
					{
						@object.name
					});
				}
				else
				{
					this.m_instanceIDAssetMap.Add(instanceID, uoi);
				}
			}
			return @object;
		}

		// Token: 0x06000A55 RID: 2645 RVA: 0x00036ED8 File Offset: 0x000350D8
		private void ReturnObject(XResourceLoaderMgr.UniteObjectInfo uoi, UnityEngine.Object obj, int instanceID, bool usePool)
		{
			if (uoi != null)
			{
				if (uoi.Return(obj, usePool))
				{
					if (this.m_degenerationQueue == null)
					{
						this.m_degenerationQueue = uoi;
						this.m_currentDegeneration = uoi;
					}
					else
					{
						if (this.m_currentDegeneration != null)
						{
							this.m_currentDegeneration.next = uoi;
							this.m_currentDegeneration = uoi;
						}
						else
						{
							this.ReturnObject(uoi);
						}
					}
					this.m_instanceIDAssetMap.Remove(instanceID);
				}
				else
				{
					if (!uoi.IsSharedResource)
					{
						this.m_instanceIDAssetMap.Remove(instanceID);
					}
				}
			}
			else
			{
				if (XResourceLoaderMgr.UniteObjectInfo.CanDestroy(obj))
				{
					UnityEngine.Object.Destroy(obj);
				}
				else
				{
					Resources.UnloadAsset(obj);
				}
			}
		}

		// Token: 0x06000A56 RID: 2646 RVA: 0x00036FA0 File Offset: 0x000351A0
		private void ReturnObject(XResourceLoaderMgr.UniteObjectInfo uoi)
		{
			if (uoi.IsDegeneration)
			{
				this.m_assetPool.Remove(uoi.hashID);
				uoi.Clear();
				this.m_objInfoPool.Enqueue(uoi);
			}
		}

		// Token: 0x06000A57 RID: 2647 RVA: 0x00036FE0 File Offset: 0x000351E0
		private XResourceLoaderMgr.UniteObjectInfo GetObjectInfo()
		{
			if (this.m_objInfoPool.Count > 0)
			{
				return this.m_objInfoPool.Dequeue();
			}
			return new XResourceLoaderMgr.UniteObjectInfo();
		}

		// Token: 0x06000A58 RID: 2648 RVA: 0x00037018 File Offset: 0x00035218
		private void PushLoadTask(uint hash, out LoadAsyncTask task)
		{
			this.isCurrentLoading = true;
			LoadAsyncTask loadAsyncTask = null;
			int count = this._async_task_list.Count;
			int i;
			for (i = 0; i < count; i++)
			{
				LoadAsyncTask loadAsyncTask2 = this._async_task_list[i];
				if (loadAsyncTask2.loadState == EAsyncLoadState.EFree)
				{
					loadAsyncTask = loadAsyncTask2;
				}
				else
				{
					if (loadAsyncTask2.hash == hash)
					{
						task = loadAsyncTask2;
						return;
					}
				}
			}
			if (loadAsyncTask == null)
			{
				for (i++; i < count; i++)
				{
					LoadAsyncTask loadAsyncTask3 = this._async_task_list[i];
					if (loadAsyncTask3.loadState == EAsyncLoadState.EFree)
					{
						loadAsyncTask = loadAsyncTask3;
						break;
					}
				}
			}
			if (loadAsyncTask == null)
			{
				loadAsyncTask = new LoadAsyncTask();
				this._async_task_list.Add(loadAsyncTask);
			}
			task = loadAsyncTask;
			task.Clear();
			task.loadState = EAsyncLoadState.EPreLoading;
		}

		// Token: 0x06000A59 RID: 2649 RVA: 0x00037104 File Offset: 0x00035304
		private LoadAsyncTask CreateAsyncTask(string location, string suffix, uint hash, LoadCallBack Cb, object cbOjb, bool sharedRes, bool usePool, Type t)
		{
			XSingleton<XDebug>.singleton.AddWarningLog("XResourceLoaderMgr CreateAsyncTask location:" + location + " suffix:" + suffix);
			LoadAsyncTask loadAsyncTask;
			this.PushLoadTask(hash, out loadAsyncTask);
			LoadInfo item;
			item.loadCb = Cb;
			item.usePool = usePool;
			loadAsyncTask.loadType = t;
			loadAsyncTask.hash = hash;
			loadAsyncTask.location = location;
			loadAsyncTask.ext = suffix;
			loadAsyncTask.isSharedRes = sharedRes;
			loadAsyncTask.cbObj = cbOjb;
			loadAsyncTask.loadCbList.Add(item);
			return loadAsyncTask;
		}

		// Token: 0x06000A5A RID: 2650 RVA: 0x00037170 File Offset: 0x00035370
		public GameObject CreateFromPrefab(string location, Vector3 position, Quaternion quaternion, bool usePool = true, bool dontDestroy = false)
		{
			GameObject gameObject = this.CreateFromPrefab(location, usePool, dontDestroy) as GameObject;
			gameObject.transform.position = position;
			gameObject.transform.rotation = quaternion;
			return gameObject;
		}

		// Token: 0x06000A5B RID: 2651 RVA: 0x000371B0 File Offset: 0x000353B0
		public UnityEngine.Object CreateFromPrefab(string location, bool usePool = true, bool dontDestroy = false)
		{
			return this.CreateFromAsset<GameObject>(location, ".prefab", usePool, dontDestroy);
		}

		// Token: 0x06000A5C RID: 2652 RVA: 0x000371D0 File Offset: 0x000353D0
		public T CreateFromAsset<T>(string location, string suffix, bool usePool = true, bool dontDestroy = false) where T : UnityEngine.Object
		{
			XSingleton<XDebug>.singleton.AddWarningLog("XResourceLoaderMgr CreateFromAsset location:" + location + " suffix:" + suffix);
			uint num = this.Hash(location, suffix);
			if (this.useNewMgr)
			{
				UnityEngine.Object @object = null;
				XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo = this.GetUOI(num, out @object, usePool);
				if (uniteObjectInfo == null)
				{
					uniteObjectInfo = this.GetObjectInfo();
					if (uniteObjectInfo.Init(location, suffix, num, false, typeof(T), true))
					{
						@object = uniteObjectInfo.Get(usePool, false);
					}
					this.m_assetPool.Add(num, uniteObjectInfo);
				}
				uniteObjectInfo.IsDontDestroyAsset = dontDestroy;
				if (@object != null)
				{
					this.m_instanceIDAssetMap.Add(@object.GetInstanceID(), uniteObjectInfo);
				}
				return (@object as T);
			}

			float time = Time.time;
			UnityEngine.Object object2 = null;
			if (usePool && this.GetInObjectPool(ref object2, num))
			{
				return object2 as T;
			}

			object2 = this.GetAssetInPool(num);
			if (object2 == null)
			{
				AssetBundleInfo assetBundleInfo = null;
				if (XSingleton<XUpdater.XUpdater>.singleton.ABManager != null)
				{
					assetBundleInfo = XSingleton<XUpdater.XUpdater>.singleton.ABManager.LoadImm(num, location, suffix, null);
				}
				if (assetBundleInfo != null)
				{
					object2 = this.CreateFromAssetBundle<T>(location, num, assetBundleInfo, true);
				}
				else
				{
					object2 = this.CreateFromAssets<T>(location, num, true);
				}
			}
			UnityEngine.Object result = null;
			result = ((object2 != null) ? XCommon.Instantiate<UnityEngine.Object>(object2) : null);
			if (result != null)
			{
				this.AssetsRefRetain(num);
				this.LogReverseID(result, num);
			}
			if (XSingleton<XDebug>.singleton.EnableRecord())
			{
				XSingleton<XDebug>.singleton.AddPoint(num, location, Time.time - time, 0, XDebug.RecordChannel.EResourceLoad);
			}
			return (result as T);
		}

		// Token: 0x06000A5D RID: 2653 RVA: 0x0003739C File Offset: 0x0003559C
		public LoadAsyncTask CreateFromPrefabAsync(string location, LoadCallBack Cb, object cbOjb, bool usePool = true)
		{
			XSingleton<XDebug>.singleton.AddWarningLog("XResourceLoaderMgr CreateFromPrefabAsync location:" + location + " suffix:" + ".prefab");
			uint num = this.Hash(location, ".prefab");
			LoadAsyncTask result;
			if (this.useNewMgr)
			{
				UnityEngine.Object obj = null;
				XResourceLoaderMgr.UniteObjectInfo uoi = this.GetUOI(num, out obj, usePool);
				if (uoi != null)
				{
					Cb(obj, cbOjb);
					result = null;
				}
				else
				{
					result = this.CreateAsyncTask(location, ".prefab", num, Cb, cbOjb, false, usePool, typeof(GameObject));
				}
			}
			else
			{
				UnityEngine.Object @object = null;
				if (usePool && this.GetInObjectPool(ref @object, num))
				{
					Cb(@object, cbOjb);
					result = null;
				}
				else
				{
					if (!this._asset_pool.TryGetValue(num, out @object))
					{
						result = this.CreateAsyncTask(location, ".prefab", num, Cb, cbOjb, false, usePool, typeof(GameObject));
					}
					else
					{
						LoadAsyncTask loadAsyncTask = this.CreateAsyncTask(location, ".prefab", num, Cb, cbOjb, false, usePool, typeof(GameObject));
						loadAsyncTask.asset = @object;
						loadAsyncTask.loadState = EAsyncLoadState.EInstance;
						result = loadAsyncTask;
					}
				}
			}
			return result;
		}

		// Token: 0x06000A5E RID: 2654 RVA: 0x000374B0 File Offset: 0x000356B0
		public T GetSharedResource<T>(string location, string suffix, bool canNotNull = true, bool preload = false) where T : UnityEngine.Object
		{
			XSingleton<XDebug>.singleton.AddWarningLog("XResourceLoaderMgr GetSharedResource location:" + location + " suffix:" + suffix);
			if(location.StartsWith("Table"))
            {
				XSingleton<XDebug>.singleton.AddWarningLog("Load Table Res location:" + location + " suffix:" + suffix);
				XSingleton<XDebug>.singleton.PrintCallTrace();
			}
			uint num = this.Hash(location, suffix);
			T result;
			if (this.useNewMgr)
			{
				UnityEngine.Object @object = null;
				XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo = this.GetUOI(num, out @object, false);
				if (uniteObjectInfo == null)
				{
					uniteObjectInfo = this.GetObjectInfo();
					uniteObjectInfo.IsDontDestroyAsset = this.dontDestroy;
					if (uniteObjectInfo.Init(location, suffix, num, true, typeof(T), canNotNull))
					{
						@object = uniteObjectInfo.Get(preload, false);
					}
					else
					{
						if (!canNotNull)
						{
							this.m_objInfoPool.Enqueue(uniteObjectInfo);
							return default(T);
						}
					}
					this.m_assetPool.Add(num, uniteObjectInfo);
					if (@object != null)
					{
						this.m_instanceIDAssetMap.Add(@object.GetInstanceID(), uniteObjectInfo);
					}
				}
				result = (@object as T);
			}
			else
			{
				float time = Time.time;
				UnityEngine.Object object2 = this.GetAssetInPool(num);
				if (object2 == null)
				{
					AssetBundleInfo assetBundleInfo = null;
					if (XSingleton<XUpdater.XUpdater>.singleton.ABManager != null)
					{
						assetBundleInfo = XSingleton<XUpdater.XUpdater>.singleton.ABManager.LoadImm(num, location, suffix, null);
					}
					if (assetBundleInfo != null)
					{
						object2 = this.CreateFromAssetBundle<T>(location, num, assetBundleInfo, canNotNull);
					}
					else
					{
						object2 = this.CreateFromAssets<T>(location, num, canNotNull);
					}
				}
				if (object2 != null)
				{
					this.AssetsRefRetain(num);
				}
				if (XSingleton<XDebug>.singleton.EnableRecord())
				{
					XSingleton<XDebug>.singleton.AddPoint(num, location, Time.time - time, 1, XDebug.RecordChannel.EResourceLoad);
				}
				result = (object2 as T);
			}
			return result;
		}

		// Token: 0x06000A5F RID: 2655 RVA: 0x00037664 File Offset: 0x00035864
		public LoadAsyncTask GetShareResourceAsync<T>(string location, string suffix, LoadCallBack Cb, object cbOjb) where T : UnityEngine.Object
		{
			uint num = this.Hash(location, suffix);
			LoadAsyncTask result;
			if (this.useNewMgr)
			{
				UnityEngine.Object obj = null;
				XResourceLoaderMgr.UniteObjectInfo uoi = this.GetUOI(num, out obj, false);
				if (uoi != null)
				{
					Cb(obj, cbOjb);
					result = null;
				}
				else
				{
					result = this.CreateAsyncTask(location, suffix, num, Cb, null, true, false, typeof(T));
				}
			}
			else
			{
				UnityEngine.Object obj2 = null;
				if (this._asset_pool.TryGetValue(num, out obj2))
				{
					Cb(obj2, cbOjb);
					this.AssetsRefRetain(num);
					result = null;
				}
				else
				{
					result = this.CreateAsyncTask(location, suffix, num, Cb, cbOjb, true, false, typeof(T));
				}
			}
			return result;
		}

		// Token: 0x06000A60 RID: 2656 RVA: 0x0003771C File Offset: 0x0003591C
		public XAnimationClip GetXAnimation(string location, bool showLog = true, bool preload = false)
		{
			XSingleton<XDebug>.singleton.AddWarningLog("XResourceLoaderMgr GetXAnimation location:" + location + " suffix:" + ".anim");
			uint num = this.Hash(location, ".anim");
			XAnimationClip result;
			if (this.useNewMgr)
			{
				UnityEngine.Object @object = null;
				XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo = this.GetUOI(num, out @object, false);
				if (uniteObjectInfo == null)
				{
					uniteObjectInfo = this.GetObjectInfo();
					if (uniteObjectInfo.InitAnim(location, ".anim", num))
					{
						@object = uniteObjectInfo.Get(false, preload);
					}
					this.m_assetPool.Add(num, uniteObjectInfo);
					if (@object != null)
					{
						this.m_instanceIDAssetMap.Add(@object.GetInstanceID(), uniteObjectInfo);
					}
				}
				result = (@object as XAnimationClip);
			}
			else
			{
				UnityEngine.Object object2 = this.GetAssetInPool(num);
				if (object2 == null)
				{
					AssetBundleInfo assetBundleInfo = null;
					if (XSingleton<XUpdater.XUpdater>.singleton.ABManager != null)
					{
						assetBundleInfo = XSingleton<XUpdater.XUpdater>.singleton.ABManager.LoadImm(num, location, ".anim", null);
					}
					if (assetBundleInfo != null)
					{
						object2 = this.CreateFromAssetBundle<XAnimationClip>(location, num, assetBundleInfo, showLog);
					}
					else
					{
						object2 = this.CreateFromAssets<XAnimationClip>(location, num, showLog);
					}
				}
				if (object2 != null)
				{
					this.AssetsRefRetain(num);
				}
				result = (object2 as XAnimationClip);
			}
			return result;
		}

		// Token: 0x06000A61 RID: 2657 RVA: 0x0003785C File Offset: 0x00035A5C
		public static void SafeGetAnimationClip(string location, ref XAnimationClip clip)
		{
			if (clip != null)
			{
				XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroyShareResource(location, ".anim", clip, false);
				clip = null;
			}
			clip = XSingleton<XResourceLoaderMgr>.singleton.GetXAnimation(location, true, false);
		}

		// Token: 0x06000A62 RID: 2658 RVA: 0x0003789E File Offset: 0x00035A9E
		public static void SafeDestroy(ref UnityEngine.Object obj, bool returnPool = true)
		{
			XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroy(obj, returnPool, false);
			obj = null;
		}

		// Token: 0x06000A63 RID: 2659 RVA: 0x0003789E File Offset: 0x00035A9E
		public static void SafeDestroy(ref GameObject obj, bool returnPool = true)
		{
			XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroy(obj, returnPool, false);
			obj = null;
		}

		// Token: 0x06000A64 RID: 2660 RVA: 0x000378B3 File Offset: 0x00035AB3
		public static void SafeDestroyShareResource(string location, ref GameObject obj, bool triggerRelease = false)
		{
			XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroyShareResource(location, ".prefab", obj, triggerRelease);
			obj = null;
		}

		// Token: 0x06000A65 RID: 2661 RVA: 0x000378CD File Offset: 0x00035ACD
		public static void SafeDestroyShareResource(string location, ref Material obj)
		{
			XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroyShareResource(location, ".mat", obj, false);
			obj = null;
		}

		// Token: 0x06000A66 RID: 2662 RVA: 0x000378E8 File Offset: 0x00035AE8
		public static void SafeDestroyShareResource(string location, ref XAnimationClip obj)
		{
			if (obj != null)
			{
				XSingleton<XResourceLoaderMgr>.singleton.UnSafeDestroyShareResource(location, ".anim", obj.clip, false);
				obj = null;
			}
		}

		// Token: 0x06000A67 RID: 2663 RVA: 0x00037920 File Offset: 0x00035B20
		private void InnerDestroy(UnityEngine.Object obj, int instanceID, bool sharedRes)
		{
			XResourceLoaderMgr.UniteObjectInfo uoi = null;
			if (this.m_instanceIDAssetMap.TryGetValue(instanceID, out uoi))
			{
				this.ReturnObject(uoi, obj, instanceID, false);
			}
			else if (sharedRes)
			{
				if (!XResourceLoaderMgr.UniteObjectInfo.CanDestroy(obj))
				{
					Resources.UnloadAsset(obj);
				}
			}
			else
			{
				if (XResourceLoaderMgr.UniteObjectInfo.CanDestroy(obj))
				{
					UnityEngine.Object.Destroy(obj);
				}
			}
		}

		// Token: 0x06000A68 RID: 2664 RVA: 0x0003798C File Offset: 0x00035B8C
		public void UnSafeDestroy(UnityEngine.Object o, bool returnPool = true, bool destroyImm = false)
		{
			if (o != null)
			{
				int instanceID = o.GetInstanceID();
				if (this.useNewMgr)
				{
					this.InnerDestroy(o, instanceID, false);
				}
				else
				{
					uint num = 0U;
					if (returnPool && this._reverse_map.TryGetValue(instanceID, out num))
					{
						this.AddToObjectPool(num, o);
					}
					else
					{
						if (this._reverse_map.TryGetValue(instanceID, out num))
						{
							this.AssetsRefRelease(num);
							this._reverse_map.Remove(instanceID);
						}
						if (destroyImm)
						{
							UnityEngine.Object.DestroyImmediate(o);
						}
						else
						{
							UnityEngine.Object.Destroy(o);
						}
					}
				}
			}
		}

		// Token: 0x06000A69 RID: 2665 RVA: 0x00037A3C File Offset: 0x00035C3C
		public void UnSafeDestroyShareResource(string location, string suffix, UnityEngine.Object o, bool triggerRelease = false)
		{
			if (o != null)
			{
				if (this.useNewMgr)
				{
					int instanceID = o.GetInstanceID();
					this.InnerDestroy(o, instanceID, true);
				}
				else
				{
					if (!string.IsNullOrEmpty(location))
					{
						uint num = this.Hash(location, suffix);
						if (this._asset_ref_count.ContainsKey(num))
						{
							if (this.AssetsRefRelease(num) && triggerRelease && !XResourceLoaderMgr.UniteObjectInfo.CanDestroy(o))
							{
								Resources.UnloadAsset(o);
							}
						}
						else
						{
							if (!XResourceLoaderMgr.UniteObjectInfo.CanDestroy(o))
							{
								if (!(XSingleton<XUpdater.XUpdater>.singleton.ABManager != null) || !XSingleton<XUpdater.XUpdater>.singleton.ABManager.CheckInDep(num))
								{
									Resources.UnloadAsset(o);
								}
							}
						}
					}
				}
			}
		}

		// Token: 0x06000A6A RID: 2666 RVA: 0x00037B24 File Offset: 0x00035D24
		private void DelayDestroy(float deltaTime, bool force)
		{
			XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo = this.m_degenerationQueue;
			this.m_degenerationQueue = null;
			XResourceLoaderMgr.UniteObjectInfo uniteObjectInfo2 = null;
			while (uniteObjectInfo != null)
			{
				XResourceLoaderMgr.UniteObjectInfo next = uniteObjectInfo.next;
				uniteObjectInfo.degenerationTime += deltaTime;
				if (force || !uniteObjectInfo.IsDegeneration || uniteObjectInfo.degenerationTime > 2f)
				{
					if (uniteObjectInfo2 != null)
					{
						uniteObjectInfo2.next = uniteObjectInfo.next;
					}
					this.ReturnObject(uniteObjectInfo);
				}
				else
				{
					uniteObjectInfo2 = uniteObjectInfo;
					if (this.m_degenerationQueue == null)
					{
						this.m_degenerationQueue = uniteObjectInfo;
					}
				}
				uniteObjectInfo = next;
			}
			this.m_currentDegeneration = this.m_degenerationQueue;
			while (this.m_currentDegeneration != null && this.m_currentDegeneration.next != null)
			{
				this.m_currentDegeneration = this.m_currentDegeneration.next;
			}
		}

		// Token: 0x06000A6B RID: 2667 RVA: 0x00037C0C File Offset: 0x00035E0C
		public void LoadABScene(string path)
		{
			uint hash = 0U;
			hash = XSingleton<XCommon>.singleton.XHashLowerRelpaceDot(hash, "Assets.XScene.Scenelib.");
			hash = XSingleton<XCommon>.singleton.XHashLowerRelpaceDot(hash, path);
			hash = XSingleton<XCommon>.singleton.XHashLowerRelpaceDot(hash, ".unity");
			AssetBundleInfo assetBundleInfo = XSingleton<XUpdater.XUpdater>.singleton.ABManager.LoadImm(hash, path, ".unity", "Assets.XScene.Scenelib.");
			if (assetBundleInfo != null)
			{
				XSingleton<XDebug>.singleton.AddLog("Load AB Scene Finish!", null, null, null, null, null, XDebugColor.XDebug_None);
			}
		}

		// Token: 0x06000A6C RID: 2668 RVA: 0x00037C88 File Offset: 0x00035E88
		public IXCurve GetCurve(string location)
		{
			bool useCurveTable = XResourceLoaderMgr.UseCurveTable;
			IXCurve result;
			if (useCurveTable)
			{
				uint num = XSingleton<XCommon>.singleton.XHash(location);
				IXCurve ixcurve = this.GetServerCurve(num);
				if (ixcurve == null)
				{
					XSingleton<XDebug>.singleton.AddLog2("curve not found:{0}|Hash:{1}", new object[]
					{
						location,
						num
					});
					GameObject sharedResource = this.GetSharedResource<GameObject>(location, ".prefab", true, false);
					ixcurve = (sharedResource.GetComponent("XCurve") as IXCurve);
				}
				result = ixcurve;
			}
			else
			{
				GameObject sharedResource2 = this.GetSharedResource<GameObject>(location, ".prefab", true, false);
				result = (sharedResource2.GetComponent("XCurve") as IXCurve);
			}
			return result;
		}

		// Token: 0x06000A6D RID: 2669 RVA: 0x00037D30 File Offset: 0x00035F30
		private FloatCurve _GetFloatCurve(uint hash)
		{
			int i = 0;
			int num = this.m_curveData.Count - 1;
			while (i <= num)
			{
				int num2 = (i + num) / 2;
				if (hash > this.m_curveData[num2].namehash)
				{
					i = num2 + 1;
				}
				else
				{
					if (hash >= this.m_curveData[num2].namehash)
					{
						return this.m_curveData[num2];
					}
					num = num2 - 1;
				}
			}
			return null;
		}

		// Token: 0x06000A6E RID: 2670 RVA: 0x00037DC0 File Offset: 0x00035FC0
		public FloatCurve GetServerCurve(uint hash)
		{
			return this._GetFloatCurve(hash);
		}

		// Token: 0x06000A6F RID: 2671 RVA: 0x00037DDC File Offset: 0x00035FDC
		public T GetData<T>(string pathwithname, string suffix)
		{
            uint key = XSingleton<XCommon>.singleton.XHash(pathwithname);
			UnityEngine.Object @object = null;
#if EDIT_DATA
            if (pathwithname.StartsWith("CutScene"))
            {
                string _outpath = Application.persistentDataPath + string.Format("/{0}/{1}{2}", new object[]
                {
				location_prefix,
				pathwithname,
                suffix
                });
                //StreamReader sr = new StreamReader("c:/jamaica.txt")
                using (FileStream fsRead = new FileStream(_outpath, FileMode.Open))
                {
                    int fsLen = (int)fsRead.Length;
                    byte[] heByte = new byte[fsLen];
                    int r = fsRead.Read(heByte, 0, heByte.Length);

                    if (!this._script_pool.TryGetValue(key, out @object))
                    {
                        int num = (typeof(T) == typeof(XCutSceneData)) ? 1 : 0;
                        XmlSerializer xmlSerializer = this.xmlSerializerCache[num];
                        this.shareMemoryStream.Seek(0L, SeekOrigin.Begin);
                        this.shareMemoryStream.SetLength(0L);
                        this.shareMemoryStream.Write(heByte, 0, heByte.Length);
                        this.shareMemoryStream.Seek(0L, SeekOrigin.Begin);
                        object data = xmlSerializer.Deserialize(this.shareMemoryStream);
                        XDataWrapper xdataWrapper = ScriptableObject.CreateInstance<XDataWrapper>();
                        xdataWrapper.Data = data;
                        @object = xdataWrapper;
                        if (null != @object)
                        {
                            this._script_pool.Add(key, @object);
                        }
                    }
                    return (T)((object)(@object as XDataWrapper).Data);
                }
            }
#endif
            if (!this._script_pool.TryGetValue(key, out @object))
			{
				TextAsset sharedResource = this.GetSharedResource<TextAsset>(pathwithname, suffix, true, false);
				if (sharedResource == null)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("Deserialize file ", pathwithname, " Error!", null, null, null);
				}
				int num = (typeof(T) == typeof(XCutSceneData)) ? 1 : 0;
				XmlSerializer xmlSerializer = this.xmlSerializerCache[num];
				this.shareMemoryStream.Seek(0L, SeekOrigin.Begin);
				this.shareMemoryStream.SetLength(0L);
				this.shareMemoryStream.Write(sharedResource.bytes, 0, sharedResource.bytes.Length);
				this.shareMemoryStream.Seek(0L, SeekOrigin.Begin);
				object data = xmlSerializer.Deserialize(this.shareMemoryStream);
				XDataWrapper xdataWrapper = ScriptableObject.CreateInstance<XDataWrapper>();
				xdataWrapper.Data = data;
				this.UnSafeDestroyShareResource(pathwithname, suffix, sharedResource, false);
				@object = xdataWrapper;
				if (null != @object)
				{
					this._script_pool.Add(key, @object);
				}
			}
			return (T)((object)(@object as XDataWrapper).Data);
		}

		// Token: 0x06000A70 RID: 2672 RVA: 0x00037F14 File Offset: 0x00036114
		public UnityEngine.Object AddAssetInPool(UnityEngine.Object asset, uint hash, AssetBundleInfo info = null)
		{
			UnityEngine.Object result;
			if (asset == null)
			{
				result = null;
			}
			else
			{
				UnityEngine.Object @object = null;
				this._asset_pool.TryGetValue(hash, out @object);
				if (@object == null)
				{
					@object = asset;
					this._asset_pool[hash] = @object;
					if (info != null && !this._bundle_pool.ContainsKey(hash))
					{
						info.Retain();
						this._bundle_pool.Add(hash, info);
					}
				}
				result = @object;
			}
			return result;
		}

		// Token: 0x06000A71 RID: 2673 RVA: 0x00037F98 File Offset: 0x00036198
		public UnityEngine.Object GetAssetInPool(uint hash)
		{
			UnityEngine.Object result = null;
			this._asset_pool.TryGetValue(hash, out result);
			return result;
		}

		// Token: 0x06000A72 RID: 2674 RVA: 0x00037FBC File Offset: 0x000361BC
		public bool GetInObjectPool(ref UnityEngine.Object o, uint id)
		{
			Queue<UnityEngine.Object> queue = null;
			if (this._object_pool.TryGetValue(id, out queue))
			{
				int count = queue.Count;
				if (count > 0)
				{
					UnityEngine.Object @object = queue.Dequeue();
					while (@object == null && queue.Count > 0)
					{
						@object = queue.Dequeue();
					}
					if (@object == null)
					{
						return false;
					}
					o = @object;
					return true;
				}
			}
			return false;
		}

		// Token: 0x06000A73 RID: 2675 RVA: 0x00038044 File Offset: 0x00036244
		private UnityEngine.Object CreateFromAssets<T>(string location, uint hash, bool showError = true)
		{
			UnityEngine.Object @object;
			if (typeof(T) == typeof(XAnimationClip))
			{
				XAnimationClip xanimationClip = XAnimationPool.Get();
				xanimationClip.clip = (Resources.Load(location, typeof(AnimationClip)) as AnimationClip);
				if (xanimationClip.clip == null)
				{
					if (showError)
					{
						XResourceLoaderMgr.LoadErrorLog(location);
					}
					return null;
				}
				xanimationClip.length = xanimationClip.clip.length;
				@object = xanimationClip;
			}
			else
			{
				@object = Resources.Load(location, typeof(T));
			}
			XResourceLoaderMgr.resourceLoadCount++;
			@object = this.AddAssetInPool(@object, hash, null);
			if (@object == null && showError)
			{
				XResourceLoaderMgr.LoadErrorLog(location);
			}
			return @object;
		}

		// Token: 0x06000A74 RID: 2676 RVA: 0x0003811C File Offset: 0x0003631C
		private UnityEngine.Object CreateFromAssetBundle<T>(string location, uint hash, AssetBundleInfo info, bool showError = true)
		{
			UnityEngine.Object @object;
			if (typeof(T) == typeof(XAnimationClip))
			{
				XAnimationClip xanimationClip = XAnimationPool.Get();
				xanimationClip.clip = (info.mainObject as AnimationClip);
				if (xanimationClip.clip == null)
				{
					if (showError)
					{
						XResourceLoaderMgr.LoadErrorLog(location);
					}
					return null;
				}
				xanimationClip.length = xanimationClip.clip.length;
				@object = xanimationClip;
			}
			else
			{
				@object = info.mainObject;
			}
			XResourceLoaderMgr.abLoadCount++;
			@object = this.AddAssetInPool(@object, hash, info);
			UnityEngine.Object result;
			if (@object == null)
			{
				if (showError)
				{
					XResourceLoaderMgr.LoadErrorLog(location);
				}
				result = null;
			}
			else
			{
				result = @object;
			}
			return result;
		}

		// Token: 0x06000A75 RID: 2677 RVA: 0x000381E0 File Offset: 0x000363E0
		private void AddToObjectPool(uint id, UnityEngine.Object obj)
		{
			Queue<UnityEngine.Object> queue = null;
			if (!this._object_pool.TryGetValue(id, out queue))
			{
				queue = new Queue<UnityEngine.Object>();
				this._object_pool.Add(id, queue);
			}
			GameObject gameObject = obj as GameObject;
			if (gameObject != null)
			{
				Transform transform = gameObject.transform;
				transform.position = XResourceLoaderMgr.Far_Far_Away;
				transform.rotation = Quaternion.identity;
				transform.parent = null;
			}
			queue.Enqueue(obj);
		}

		// Token: 0x06000A76 RID: 2678 RVA: 0x00038264 File Offset: 0x00036464
		public void AssetsRefRetain(uint hash)
		{
			int num = 0;
			this._asset_ref_count.TryGetValue(hash, out num);
			num++;
			this._asset_ref_count[hash] = num;
		}

		// Token: 0x06000A77 RID: 2679 RVA: 0x00038298 File Offset: 0x00036498
		public bool AssetsRefRelease(uint hash)
		{
			int num = 0;
			if (this._asset_ref_count.TryGetValue(hash, out num))
			{
				num--;
				if (num < 0)
				{
					num = 0;
				}
				if (num == 0)
				{
					this._asset_pool.Remove(hash);
					this._asset_ref_count.Remove(hash);
					AssetBundleInfo assetBundleInfo = null;
					if (this._bundle_pool.TryGetValue(hash, out assetBundleInfo))
					{
						assetBundleInfo.Release();
						this._bundle_pool.Remove(hash);
						return false;
					}
					return true;
				}
				else
				{
					this._asset_ref_count[hash] = num;
				}
			}
			return false;
		}

		// Token: 0x06000A78 RID: 2680 RVA: 0x00038340 File Offset: 0x00036540
		public void LogReverseID(UnityEngine.Object o, uint id)
		{
			if (o != null)
			{
				int instanceID = o.GetInstanceID();
				if (!this._reverse_map.ContainsKey(instanceID))
				{
					this._reverse_map.Add(instanceID, id);
				}
			}
		}

		// Token: 0x06000A79 RID: 2681 RVA: 0x00038383 File Offset: 0x00036583
		public static void LoadErrorLog(string prefab)
		{
			XSingleton<XDebug>.singleton.AddErrorLog("Load resource: ", prefab, " error!", null, null, null);
		}

		// Token: 0x06000A7A RID: 2682 RVA: 0x000383A0 File Offset: 0x000365A0
		public void Update(float deltaTime)
		{
			bool flag = false;
			bool flag2 = true;
			float time = Time.time;
			for (int i = 0; i < this._async_task_list.Count; i++)
			{
				LoadAsyncTask loadAsyncTask = this._async_task_list[i];
				if (flag2)
				{
					if (loadAsyncTask.Update())
					{
						loadAsyncTask.Clear();
					}
					float num = Time.time - time;
					if (num >= this.maxLoadThresholdTime)
					{
						flag2 = false;
					}
				}
				flag |= (loadAsyncTask.loadState == EAsyncLoadState.ELoading);
			}
			if (!flag)
			{
				this.isCurrentLoading = false;
			}
			this.DelayDestroy(deltaTime, false);
			this.UpdateDelayProcess(deltaTime);
		}

		// Token: 0x06000A7B RID: 2683 RVA: 0x00038454 File Offset: 0x00036654
		public void AddDelayProcess(IDelayLoad loader)
		{
			int i = 0;
			int count = this.delayUpdateList.Count;
			while (i < count)
			{
				IDelayLoad delayLoad = this.delayUpdateList[i];
				if (delayLoad == loader)
				{
					return;
				}
				i++;
			}
			if (this.currentDelayTime < 0.0)
			{
				this.currentDelayTime = XResourceLoaderMgr.delayTime;
			}
			this.delayUpdateList.Add(loader);
		}

		// Token: 0x06000A7C RID: 2684 RVA: 0x000384C9 File Offset: 0x000366C9
		public void RemoveDelayProcess(IDelayLoad loader)
		{
			this.delayUpdateList.Remove(loader);
		}

		// Token: 0x06000A7D RID: 2685 RVA: 0x000384DC File Offset: 0x000366DC
		public void UpdateDelayProcess(float deltaTime)
		{
			if (this.delayUpdateList.Count > 0)
			{
				this.currentDelayTime -= XResourceLoaderMgr.delayTime;
				if (this.currentDelayTime <= 0.0)
				{
					IDelayLoad delayLoad = this.delayUpdateList[0];
					EDelayProcessType edelayProcessType = delayLoad.DelayUpdate();
					if (edelayProcessType == EDelayProcessType.EFinish)
					{
						this.delayUpdateList.RemoveAt(0);
						if (this.delayUpdateList.Count > 0)
						{
							this.currentDelayTime = XResourceLoaderMgr.delayTime;
						}
					}
				}
			}
		}

		// Token: 0x040004D9 RID: 1241
		public static uint Preload = 1U;

		// Token: 0x040004DA RID: 1242
		public static uint SharedResource = 2U;

		// Token: 0x040004DB RID: 1243
		public static uint DontDestroyAsset = 4U;

		// Token: 0x040004DC RID: 1244
		public static uint Degeneration = 8U;

		// Token: 0x040004DD RID: 1245
		public static readonly Vector3 Far_Far_Away = new Vector3(0f, -1000f, 0f);

		// Token: 0x040004DE RID: 1246
		public bool useNewMgr = false;

		// Token: 0x040004DF RID: 1247
		public bool dontDestroy = false;

		// Token: 0x040004E0 RID: 1248
		private Dictionary<uint, AssetBundleInfo> _bundle_pool = new Dictionary<uint, AssetBundleInfo>();

		// Token: 0x040004E1 RID: 1249
		private Dictionary<uint, int> _asset_ref_count = new Dictionary<uint, int>();

		// Token: 0x040004E2 RID: 1250
		private Dictionary<uint, Queue<UnityEngine.Object>> _object_pool = new Dictionary<uint, Queue<UnityEngine.Object>>();

		// Token: 0x040004E3 RID: 1251
		private Dictionary<uint, UnityEngine.Object> _asset_pool = new Dictionary<uint, UnityEngine.Object>();

		// Token: 0x040004E4 RID: 1252
		private Dictionary<uint, UnityEngine.Object> _script_pool = new Dictionary<uint, UnityEngine.Object>();

		// Token: 0x040004E5 RID: 1253
		private Dictionary<int, uint> _reverse_map = new Dictionary<int, uint>();

		// Token: 0x040004E6 RID: 1254
		private Dictionary<uint, XResourceLoaderMgr.UniteObjectInfo> m_assetPool = new Dictionary<uint, XResourceLoaderMgr.UniteObjectInfo>();

		// Token: 0x040004E7 RID: 1255
		private Dictionary<int, XResourceLoaderMgr.UniteObjectInfo> m_instanceIDAssetMap = new Dictionary<int, XResourceLoaderMgr.UniteObjectInfo>();

		// Token: 0x040004E8 RID: 1256
		private Queue<XResourceLoaderMgr.UniteObjectInfo> m_objInfoPool = new Queue<XResourceLoaderMgr.UniteObjectInfo>();

		// Token: 0x040004E9 RID: 1257
		private XResourceLoaderMgr.UniteObjectInfo m_degenerationQueue = null;

		// Token: 0x040004EA RID: 1258
		private XResourceLoaderMgr.UniteObjectInfo m_currentDegeneration = null;

		// Token: 0x040004EB RID: 1259
		private List<FloatCurve> m_curveData = null;

		// Token: 0x040004EC RID: 1260
		public static bool UseCurveTable = false;

		// Token: 0x040004ED RID: 1261
		private BeforeUnityUnLoadResource m_BeforeUnityUnLoadResourceCb = null;

		// Token: 0x040004EE RID: 1262
		private XmlSerializer[] xmlSerializerCache = new XmlSerializer[2];

		// Token: 0x040004EF RID: 1263
		private MemoryStream shareMemoryStream = new MemoryStream(8192);

		// Token: 0x040004F0 RID: 1264
		private List<LoadAsyncTask> _async_task_list = new List<LoadAsyncTask>();

		// Token: 0x040004F1 RID: 1265
		private List<IDelayLoad> delayUpdateList = new List<IDelayLoad>();

		// Token: 0x040004F2 RID: 1266
		public static double delayTime = 0.5;

		// Token: 0x040004F3 RID: 1267
		private double currentDelayTime = -1.0;

		// Token: 0x040004F4 RID: 1268
		public bool DelayLoad = false;

		// Token: 0x040004F5 RID: 1269
		public bool isCurrentLoading = false;

		// Token: 0x040004F6 RID: 1270
		public float maxLoadThresholdTime = 0.1f;

		// Token: 0x040004F7 RID: 1271
		public static int resourceLoadCount = 0;

		// Token: 0x040004F8 RID: 1272
		public static int abLoadCount = 0;

		// Token: 0x040004F9 RID: 1273
		public static int instanceCount = 0;

		// Token: 0x040004FA RID: 1274
		private uint _prefixHash = 0U;

#if EDIT_DATA
#if UNITY_2017
		public static string location_prefix = "HeroWorld";
#else
		public static string location_prefix = "LZG";
#endif
#endif

		// Token: 0x0200039F RID: 927
		public class UniteObjectInfo
		{
			// Token: 0x17000120 RID: 288
			// (get) Token: 0x06000F5F RID: 3935 RVA: 0x0004AF04 File Offset: 0x00049104
			// (set) Token: 0x06000F60 RID: 3936 RVA: 0x0004AF28 File Offset: 0x00049128
			public bool HasPreload
			{
				get
				{
					return (this.m_flag & XResourceLoaderMgr.Preload) > 0U;
				}
				set
				{
					if (value)
					{
						this.m_flag |= XResourceLoaderMgr.Preload;
					}
					else
					{
						this.m_flag &= ~XResourceLoaderMgr.Preload;
					}
				}
			}

			// Token: 0x17000121 RID: 289
			// (get) Token: 0x06000F61 RID: 3937 RVA: 0x0004AF68 File Offset: 0x00049168
			// (set) Token: 0x06000F62 RID: 3938 RVA: 0x0004AF8C File Offset: 0x0004918C
			public bool IsSharedResource
			{
				get
				{
					return (this.m_flag & XResourceLoaderMgr.SharedResource) > 0U;
				}
				set
				{
					if (value)
					{
						this.m_flag |= XResourceLoaderMgr.SharedResource;
					}
					else
					{
						this.m_flag &= ~XResourceLoaderMgr.SharedResource;
					}
				}
			}

			// Token: 0x17000122 RID: 290
			// (get) Token: 0x06000F63 RID: 3939 RVA: 0x0004AFCC File Offset: 0x000491CC
			// (set) Token: 0x06000F64 RID: 3940 RVA: 0x0004AFF0 File Offset: 0x000491F0
			public bool IsDontDestroyAsset
			{
				get
				{
					return (this.m_flag & XResourceLoaderMgr.DontDestroyAsset) > 0U;
				}
				set
				{
					if (value)
					{
						this.m_flag |= XResourceLoaderMgr.DontDestroyAsset;
					}
					else
					{
						this.m_flag &= ~XResourceLoaderMgr.DontDestroyAsset;
					}
				}
			}

			// Token: 0x17000123 RID: 291
			// (get) Token: 0x06000F65 RID: 3941 RVA: 0x0004B030 File Offset: 0x00049230
			// (set) Token: 0x06000F66 RID: 3942 RVA: 0x0004B054 File Offset: 0x00049254
			public bool IsDegeneration
			{
				get
				{
					return (this.m_flag & XResourceLoaderMgr.Degeneration) > 0U;
				}
				set
				{
					if (value)
					{
						this.m_flag |= XResourceLoaderMgr.Degeneration;
					}
					else
					{
						this.m_flag &= ~XResourceLoaderMgr.Degeneration;
					}
				}
			}

			// Token: 0x06000F67 RID: 3943 RVA: 0x0004B094 File Offset: 0x00049294
			private void InitAB(string location, string suffix)
			{
				if (XSingleton<XUpdater.XUpdater>.singleton.ABManager != null)
				{
					this.assetBundleInfo = XSingleton<XUpdater.XUpdater>.singleton.ABManager.LoadImm(this.hashID, location, suffix, null);
				}
			}

			// Token: 0x06000F68 RID: 3944 RVA: 0x0004B0D8 File Offset: 0x000492D8
			public bool Init(string location, string suffix, uint hash, bool isSharedResource, Type t, bool canNotNull)
			{
				this.loc = location;
				this.IsSharedResource = isSharedResource;
				this.hashID = hash;
				this.InitAB(location, suffix);
				if (this.assetBundleInfo != null)
				{
					this.asset = this.assetBundleInfo.mainObject;
				}
				else
				{
					this.asset = Resources.Load(location, t);
				}
				bool result;
				if (this.asset == null && canNotNull)
				{
					XResourceLoaderMgr.LoadErrorLog(location);
					result = false;
				}
				else
				{
					result = canNotNull;
				}
				return result;
			}

			// Token: 0x06000F69 RID: 3945 RVA: 0x0004B168 File Offset: 0x00049368
			public bool InitAnim(string location, string suffix, uint hash)
			{
				this.loc = location;
				this.IsSharedResource = true;
				this.hashID = hash;
				this.InitAB(location, suffix);
				float length = 0f;
				AnimationClip animationClip;
				if (this.assetBundleInfo != null)
				{
					animationClip = (this.assetBundleInfo.mainObject as AnimationClip);
					if (animationClip != null)
					{
						length = animationClip.length;
					}
				}
				else
				{
					animationClip = Resources.Load<AnimationClip>(location);
					if (animationClip != null)
					{
						length = animationClip.length;
					}
				}
				bool result;
				if (animationClip == null)
				{
					XResourceLoaderMgr.LoadErrorLog(location);
					result = false;
				}
				else
				{
					XAnimationClip xanimationClip = XAnimationPool.Get();
					xanimationClip.clip = animationClip;
					xanimationClip.length = length;
					this.asset = xanimationClip;
					result = true;
				}
				return result;
			}

			// Token: 0x06000F6A RID: 3946 RVA: 0x0004B234 File Offset: 0x00049434
			public bool InitAsync(string location, uint hash, UnityEngine.Object asyncAsset, AssetBundleInfo info, bool isSharedResource, bool showLog)
			{
				this.loc = location;
				this.IsSharedResource = isSharedResource;
				this.hashID = hash;
				this.assetBundleInfo = info;
				if (this.assetBundleInfo != null)
				{
					this.asset = this.assetBundleInfo.mainObject;
				}
				else
				{
					this.asset = asyncAsset;
				}
				if (this.asset is AnimationClip)
				{
					float length = 0f;
					AnimationClip animationClip;
					if (this.assetBundleInfo != null)
					{
						animationClip = (this.assetBundleInfo.mainObject as AnimationClip);
						if (animationClip != null)
						{
							length = animationClip.length;
						}
					}
					else
					{
						animationClip = (asyncAsset as AnimationClip);
						if (animationClip != null)
						{
							length = animationClip.length;
						}
					}
					if (animationClip != null)
					{
						XAnimationClip xanimationClip = XAnimationPool.Get();
						xanimationClip.clip = animationClip;
						xanimationClip.length = length;
						this.asset = xanimationClip;
					}
				}
				bool result;
				if (this.asset == null && showLog)
				{
					XResourceLoaderMgr.LoadErrorLog(location);
					result = false;
				}
				else
				{
					result = true;
				}
				return result;
			}

			// Token: 0x06000F6B RID: 3947 RVA: 0x0004B35C File Offset: 0x0004955C
			public UnityEngine.Object Get(bool useObjPool, bool preload = false)
			{
				UnityEngine.Object @object = null;
				this.IsDegeneration = false;
				if (preload)
				{
					this.HasPreload = true;
				}
				bool isSharedResource = this.IsSharedResource;
				if (isSharedResource)
				{
					@object = this.asset;
				}
				else
				{
					if (useObjPool && this.objPool != null && this.objPool.Count > 0)
					{
						@object = this.objPool.Dequeue();
					}
					else
					{
						if (this.asset != null)
						{
							@object = XCommon.Instantiate<UnityEngine.Object>(this.asset);
						}
						else
						{
							XSingleton<XDebug>.singleton.AddErrorLog("null asset when instantiate asset", null, null, null, null, null);
						}
					}
				}
				if (@object != null)
				{
					this.refCount++;
					if (this.assetBundleInfo != null && this.refCount == 1)
					{
						this.assetBundleInfo.Retain();
					}
				}
				return @object;
			}

			// Token: 0x06000F6C RID: 3948 RVA: 0x0004B454 File Offset: 0x00049654
			public bool Return(UnityEngine.Object obj, bool useObjPool)
			{
				this.refCount--;
				bool result;
				if (this.asset != null && this.refCount <= 0)
				{
					if (!this.IsSharedResource)
					{
						if (this.objPool == null)
						{
							this.objPool = QueuePool<UnityEngine.Object>.Get();
						}
						this.objPool.Enqueue(obj);
					}
					this.IsDegeneration = true;
					this.degenerationTime = 0f;
					result = true;
				}
				else
				{
					if (!this.IsSharedResource && obj != null)
					{
						if (useObjPool)
						{
							if (obj is GameObject)
							{
								GameObject gameObject = obj as GameObject;
								gameObject.transform.position = XResourceLoaderMgr.Far_Far_Away;
								gameObject.transform.rotation = Quaternion.identity;
								gameObject.transform.parent = null;
							}
							if (this.objPool == null)
							{
								this.objPool = QueuePool<UnityEngine.Object>.Get();
							}
							this.objPool.Enqueue(obj);
						}
						else
						{
							if (XResourceLoaderMgr.UniteObjectInfo.CanDestroy(obj))
							{
								UnityEngine.Object.Destroy(obj);
							}
						}
					}
					result = false;
				}
				return result;
			}

			// Token: 0x06000F6D RID: 3949 RVA: 0x0004B598 File Offset: 0x00049798
			public void Clear()
			{
				if (this.objPool != null)
				{
					while (this.objPool.Count > 0)
					{
						UnityEngine.Object obj = this.objPool.Dequeue();
						UnityEngine.Object.Destroy(obj);
					}
					QueuePool<UnityEngine.Object>.Release(this.objPool);
					this.objPool = null;
				}
				if (this.assetBundleInfo != null)
				{
					this.assetBundleInfo.Release();
				}
				else
				{
					if (!XResourceLoaderMgr.UniteObjectInfo.CanDestroy(this.asset))
					{
						Resources.UnloadAsset(this.asset);
					}
					else
					{
						if (this.asset is XAnimationClip)
						{
							XAnimationClip xanimationClip = this.asset as XAnimationClip;
							if (xanimationClip.clip != null)
							{
								Resources.UnloadAsset(xanimationClip.clip);
							}
							XAnimationPool.Release(xanimationClip);
						}
					}
				}
				this.loc = "";
				this.hashID = 0U;
				this.asset = null;
				this.refCount = 0;
				this.next = null;
				this.degenerationTime = 0f;
				this.IsDegeneration = false;
				this.assetBundleInfo = null;
			}

			// Token: 0x06000F6E RID: 3950 RVA: 0x0004B6C0 File Offset: 0x000498C0
			public void ClearPool()
			{
				if (this.objPool != null)
				{
					while (this.objPool.Count > 0)
					{
						UnityEngine.Object obj = this.objPool.Dequeue();
						UnityEngine.Object.Destroy(obj);
					}
					QueuePool<UnityEngine.Object>.Release(this.objPool);
					this.objPool = null;
				}
			}

			// Token: 0x06000F6F RID: 3951 RVA: 0x0004B71C File Offset: 0x0004991C
			public static bool CanDestroy(UnityEngine.Object obj)
			{
				return obj is GameObject || obj is ScriptableObject || obj is Material;
			}

			// Token: 0x04001039 RID: 4153
			public uint hashID = 0U;

			// Token: 0x0400103A RID: 4154
			public UnityEngine.Object asset = null;

			// Token: 0x0400103B RID: 4155
			public int refCount = 0;

			// Token: 0x0400103C RID: 4156
			public AssetBundleInfo assetBundleInfo = null;

			// Token: 0x0400103D RID: 4157
			public Queue<UnityEngine.Object> objPool = null;

			// Token: 0x0400103E RID: 4158
			public string loc = "";

			// Token: 0x0400103F RID: 4159
			private uint m_flag = 0U;

			// Token: 0x04001040 RID: 4160
			public XResourceLoaderMgr.UniteObjectInfo next = null;

			// Token: 0x04001041 RID: 4161
			public float degenerationTime = 0f;
		}
	}
}
